<?php
    if (!defined('EXPONENT')) exit('');
    global $user;
    if(exponent_users_isLoggedIn())
    {
        global $db;
        global $user;
        
        $template = new template('profilemodule','_profile_main',$loc);
        $template->assign('moduletitle',$title);
        //if admin
        
        $profile_detail = $db->selectObject('profilemodule_profile',"user_id= ".$user->id);
        $template->assign('profile_detail',$profile_detail);
        $template->assign('admin',exponent_users_isAdmin()?1:0);
        $template->register_permissions(array('administrate','configure','create','edit','delete'),$loc);
        
        $template->output();

    }
?>
